<?php
class PageAction extends Action{
	
	//我们是谁? 关于我们
	function about(){
		$this->display('web@about');
	}
	
	//报价
	function wang_zhan_bao_jia(){
		$baojia = $_POST['hid'];
		if($baojia=='baojia'){
			error_reporting(E_STRICT);
			date_default_timezone_set('Asia/Shanghai');
			include("semail/class.phpmailer.php");
			$mail             = new PHPMailer();
			$body = '网站名称：'.addslashes($_POST['name']).'<BR>';
			$body .= 'Email：'.addslashes($_POST['email']).'<BR>';
			$body .= 'QQ/MSN/手机：'.addslashes($_POST['link']).'<BR>';
			$body .= '简介：'.addslashes($_POST['message']);
			$mail->IsSMTP();
			$mail->SMTPAuth   = true;                  // enable SMTP authentication
			$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
			$mail->Host       = "smtp.qq.com";      // sets GMAIL as the SMTP server
			$mail->Port       = 465;                   // set the SMTP port for the GMAIL server
			$mail->Username   = "568142527@qq.com";  // GMAIL username
			$mail->Password   = "wyflyaway";            // GMAIL password
			$mail->From       = "568142527@qq.com";
			$mail->FromName   = "网站建设";
			$mail->Subject    = "报名啦!";
			$mail->WordWrap   = 50; //自动换行
			$mail->MsgHTML($body);
			$mail->AddAddress("568142527@qq.com");
			$mail->IsHTML(true);
			if($mail->SendEE()){
				$ss = "<script>alert('我们已经收到你的信息，会尽快为你报价!');window.top.location.reload()</script>";
			}else{
				$ss = "<script>alert('发送出现问题，请重试! 或直接我们联系')</script>";
			}
			echo $ss;
		}
		$arr = PHPAction::gf();

		foreach ($arr as $k=>$v){
			if($k==5){
				break;
			}
			$list[$k] = explode('||',$v);
			$list[$k][2] = msubstr(strip_tags($list[$k][2]),0,64).'......';
		}
		$this->assign('list',$list);
		$this->display('web@wang_zhan_bao_jia');
	}
	
	//联系我们
	function contact_us(){
	    $arr = PHPAction::gf();

    	foreach ($arr as $k=>$v){
		    if($k==5){
			  break;
			}
			$list[$k] = explode('||',$v);
			$list[$k][2] = msubstr(strip_tags($list[$k][2]),0,64).'......';
			
		}
		
		$this->assign('list',$list);
		
		$this->display('web@contact_us');
	}
}
?>